package leetcode.每日一题;

import org.junit.Test;

/**
 * @author ：zsy
 * @date ：Created 2022/12/25 8:10 PM
 * @description：
 */
public class 执行操作后的变量值 {
    @Test
    public void test() {

    }

    class Solution {
        public int finalValueAfterOperations(String[] operations) {
            int ans = 0;
            for (String operation : operations) {
                if (operation.contains("+")) {
                    ans++;
                } else {
                    ans--;
                }
            }
            return ans;
        }
    }
}
